<template>
  <div class="app-container">
    <div class="topSearch">
      <el-row>
        <el-button
          v-preventReClick
          type="primary"
          @click="orderPull('more')"
        >Sync orders</el-button>
      </el-row>
    </div>
    <order-log />
  </div>
</template>

<script>
import { orderPull } from '@/api/authorized';
import OrderLog from '@/views/taskLog';
export default {
  components: {
    OrderLog
  },
  data() {
    return {};
  },
  computed: {
    sidebar() {
      return this.$store.state.app.sidebar.opened;
    }
  },
  mounted() {},
  methods: {
    orderPull(type, id) {
      // 拉取订单
      const ids = [];
      if (this.multipleSelection.length < 1) {
        this.$message.warning('Please select at least one option');
        return false;
      } else {
        // this.$message.info('Began to pull')
        this.multipleSelection.forEach(item => {
          ids.push(item.id);
        });
        orderPull(ids).then(res => {
          if (res.code === 200) {
            this.$message.success(res.message);
          }
        });
      }
    }
  }
};
</script>
<style lang="scss" scoped></style>
